package com.geekjob1120.geekjob1120pay.modle;

public enum PayWay {

    UNIONPAY( "1","银联支付"),
    WECHATPAY( "2","微信支付"),
    ALIPAY( "3","支付宝");

    private String code;
    private String desc;

    private PayWay(String code,String desc) {
        this.code = code;
        this.desc = desc;
    }

    public String getCode(){
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public static PayWay getByCode(String code){
        for (PayWay payWay:values()){
            if (payWay.getCode().equals(code)){
                return payWay;
            }
        }
        return null;
    }
}
